DetectPlayer dp; private void Awake() { GameObject gameObject = new GameObject("DetectPlayer"); dp = gameObject.AddComponent<DetectPlayer>(); }